home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
ETO Development Tools 4
/
ETO Development Tools 4.iso
/
Tools - Objects
/
MacApp
/
MacApp 2.0.1
/
MacApp CD Release
/
MacApp® 2.0.1 Tutorial
/
Chapter 10
/
UIconEdit.p
< prev
Wrap
Text File
|
1990-10-25
|
3KB
|
129 lines
{Copyright © 1989 by Apple Computer, Inc. All rights reserved.}
UNIT UIconEdit;
INTERFACE
USES
{ • MacApp }
UMacApp,
{ • Toolbox }
ToolUtils;
CONST kSignature = 'ICED';
kFileType = 'IDOC';
TYPE
TIconApplication = OBJECT(TApplication)
PROCEDURE TIconApplication.IIconApplication(iconFileType: OSType);
{Initializes the application and globals.}
FUNCTION TIconApplication.DoMakeDocument(itsCmdNumber: CmdNumber): TDocument; OVERRIDE;
{ Creates a document of type TIconDocument and returns a reference to it.}
END;
TIconDocument = OBJECT(TDocument)
fIconBitMap: TIconBitMap; { The document’s icon object. }
PROCEDURE TIconDocument.IIconDocument;
{ Initializes the document. }
PROCEDURE TIconDocument.Free; OVERRIDE;
{ Frees allocated memory when the document is closed. }
PROCEDURE TIconDocument.DoInitialState; OVERRIDE;
{ Sets the document's data to represent a "new" document. }
PROCEDURE TIconDocument.DoMakeViews (forPrinting: BOOLEAN); OVERRIDE;
{ Creates the window and view objects when an icon document is opened.}
PROCEDURE TIconDocument.Fields (PROCEDURE DoToField (fieldName: Str255;
fieldAddr: Ptr;
fieldType: INTEGER)); OVERRIDE;
END;
TIconView = OBJECT(TView)
fMagnification: INTEGER; { No. of times to magnify the icon. }
fIconDocument: TIconDocument; { Reference to the view's icon document.}
PROCEDURE TIconView.IRes (itsDocument: TDocument; itsSuperView: TView;
VAR itsParams: Ptr); OVERRIDE;
{ Initializes the view from a resource template. }
PROCEDURE TIconView.CalcMinSize (VAR minSize: VPoint); OVERRIDE;
{ Returns the view's minimum size. }
PROCEDURE TIconView.Draw (area: Rect); OVERRIDE;
{ Draws this view. }
PROCEDURE TIconView.Fields (PROCEDURE DoToField (fieldName: Str255;
fieldAddr: Ptr;
fieldType: INTEGER)); OVERRIDE;
END;
TIconBitMap = OBJECT(TObject)
fDataHandle: Handle; { Handle to the icon's bit map. }
PROCEDURE TIconBitMap.IIconBitMap;
{ Initialize the IconBitMap object and allocate space for its data. }
PROCEDURE TIconBitMap.Free; OVERRIDE;
{ Free the icon's bit map. }
PROCEDURE TIconBitMap.SetIconBitMap(theBitMap : Handle);
{ Set the contents of the icon bit map to the new bit map. }
PROCEDURE TIconBitMap.Clear;
{ Clear the icon map by setting its bits to zero. }
PROCEDURE TIconBitMap.Invert;
{ Invert the icon's bit map. }
PROCEDURE TIconBitMap.IconBitToWordBit (iconBit: Point; VAR word, bit: INTEGER);
{ Convert icon bit numbers to the corresponding word and bit number. }
FUNCTION TIconBitMap.GetBit(iconBit: Point): BOOLEAN;
{ Return the state of the given bit. }
PROCEDURE TIconBitMap.SetBit(iconBit: Point; turnBitOn: BOOLEAN);
{ Set the state of the given bit as indicated. }
PROCEDURE TIconBitMap.Draw (area: Rect);
{ Draw the icon's bit map. }
FUNCTION TIconBitMap.Copy: TIconBitMap;
{ Create a new icon object which is a copy of itself. }
PROCEDURE TIconBitMap.CopyDataTo (anIcon: TIconBitMap);
{ Copy icon data to an existing icon object. }
PROCEDURE TIconBitMap.Fields (PROCEDURE DoToField (fieldName: Str255;
fieldAddr: Ptr;
fieldType: INTEGER)); OVERRIDE;
END;
IMPLEMENTATION
{$I UIconEdit.inc1.p}
END.